﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;

namespace deviceManage.Models
{
    public partial class Device
    {
        public Device()
        {            
            DeviceServiceLog = new HashSet<DeviceServiceLog>(); 
            MoveoutLog = new HashSet<MoveoutLog>();
            PlanExecuteTime = new HashSet<PlanExecuteTime>(); 
            ScrapLog = new HashSet<ScrapLog>();
            TransferLog = new HashSet<TransferLog>();
        }

        public string Id { get; set; }
        public string Name { get; set; }
        public string Model { get; set; }
        public sbyte? IsDomestic { get; set; }
        /// <summary>
        /// 固定资产编号
        /// </summary>
        public string No { get; set; }
        public string DeviceTypeId { get; set; }
        /// <summary>
        /// 供应商ID
        /// </summary>
        public string SupplierId { get; set; }        
        public string RoomId { get; set; }
        public string Location { get; set; }
        public string ProjectId { get; set; }
        public string Ip { get; set; }
        public DateTime? BuyDate { get; set; }
        public DateTime? ReceiveDate { get; set; }
        
        /// <summary>
        /// 在保日期
        /// </summary>
        public DateTime? ServiceDate { get; set; }
        public string DepartId { get; set; }
        public string Os { get; set; }
        public string BuyContractId { get; set; }
        public string ServiceContract { get; set; }
        public string Remark { get; set; }
        public int? Status { get; set; }
        /// <summary>
        /// 设备编码
        /// </summary>
        public string DeviceId { get; set; }
        /// <summary>
        /// 是否被删除，1删除，0未删除
        /// </summary>
        public int Deleted { get; set; }

        [NotMapped]
        public bool IsEdit { get; set; }

        /// <summary>
        /// 项目建设部门
        /// </summary>
        public string owner_unit { get; set; }

        public BuyContract BuyContract { get; set; }
        public DeviceType DeviceType{ get; set; }
        public Room Room { get; set; }
        public Project Project { get; set; }
        public ServiceContract ServiceContractNavigation { get; set; }
        public Depart Depart { get; set; }
        public Supplier Supplier { get; set; }        
        public ICollection<DeviceServiceLog> DeviceServiceLog { get; set; } 
        public ICollection<MoveoutLog> MoveoutLog { get; set; }
        public ICollection<PlanExecuteTime> PlanExecuteTime { get; set; } 
        public ICollection<ScrapLog> ScrapLog { get; set; }
        public ICollection<TransferLog> TransferLog { get; set; }
    }
}
